function animateFunc(options) {
  var from = options.from,
    to = options.to,
    totalMs = options.totalMs || 1000,
    updateTime = options.updateTime || 15,
    times = totalMs / updateTime,
    currTime = 0,
    eachChangeVal = (to - from) / times;
  var timerId = setInterval(() => {
    from += eachChangeVal;
    currTime++;
    if (currTime >= times) {
      from = to;
      clearInterval(timerId);
      options.onOk && options.onOk();
    }
    options.onChange && options.onChange(from);
  }, updateTime);
}
